<!DOCTYPE html>
<html lang="en">
<head>
[#include "/customer/include/static.htm"]
    <link href="${path}/resources/css/user.css?v=3" rel="stylesheet" type="text/css"/>
    <link href="${path}/resources/plug/layui/css/layui.css" rel="stylesheet" type="text/css"/>
    <script src="${path}/resources/plug/layui/layui.js" type="text/javascript"></script>

[#--<link href="${path}/resources/css/public.css" rel="stylesheet"  type="text/css" />--]
    <script type="text/javascript" src="${path}/resources/js/jquery.form.js"></script>
    <style type="text/css">

    </style>
</head>
<body>
<!--头部-->
[#include "/customer/include/header.ftl"]

<script>


    function closeTips(e) {
        $(".alert").hide(300);
    }

</script>

<!--头部 end -->
<!-- container start -->
<div class="member">
    <style>
        .btnRed_F_small {
            width: 80px;
            height: 36px;
            line-height: 34px;
            overflow: hidden;
            display: block;
            margin: 0 auto;
            color: #fff;
            font-size: 16px;
            text-align: center;
            cursor: pointer;
            outline: none;
            background-color: #F3485A;

        }

        td {
            border: #c0c9d5 1px solid !important;;
        }

        tr {
            border: #c0c9d5 1px solid !important;
        }

        th {
            border: #c0c9d5 1px solid !important;;
        }

        .alert {
            padding: 8px 35px 8px 14px;
            margin-bottom: 20px;
            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
            background-color: #fcf8e3;
            border: 1px solid #fbeed5;
            -webkit-border-radius: 4px;
            -moz-border-radius: 4px;
            border-radius: 4px
        }

        .alert .close {
            position: relative;
            top: -2px;
            right: -21px;
            line-height: 20px
        }

        .alert-info {
            color: #861E03;
            background: none repeat scroll 0% 0% #FFDFA2;
            border-color: #FFDFA2;
        }

        .close {
            float: right;
            font-size: 20px;
            font-weight: bold;
            line-height: 20px;
            color: #000;
            text-shadow: 0 1px 0 #fff;
            opacity: .2;
            filter: alpha(opacity=20)
        }

        .close:hover, .close:focus {
            color: #000;
            text-decoration: none;
            cursor: pointer;
            opacity: .4;
            filter: alpha(opacity=40)
        }

        .layer-input {height:38px;line-height:38px;line-height:36px\9;border:1px solid #e6e6e6;background-color:#fff;border-radius:2px;width: 75%}

    </style>
    <!--左边-->
    <style>
        .btnRed_F_small{
            width: 80px;
            height: 36px;
            line-height: 34px;
            overflow: hidden;
            display: block;
            margin: 0 auto;
            color: #fff;
            font-size: 16px;
            text-align: center;
            cursor: pointer;
            outline: none;
            background-color: #F3485A;

        }

        td {
            border: #c0c9d5 1px solid!important;;
        }
        tr{
            border: #c0c9d5 1px solid!important;
        }
        th{
            border: #c0c9d5 1px solid!important;;
        }
    </style>

    <script>
        layui.use(['form','layer'], function(){
            var form = layui.form(), $=layui.jquery, layer = layui.layer;});
        function opens(){
            if(confirm("确定开通活期宝账户吗")){
                $.post('/member/current/open',
                        {

                        },function(returnedData,status){
                            layer.msg("开通成功",function(){
                                location.reload();

                            });

//                            if(returnedData.code == 0){
//                                $.dialog({
//                                    title:'温馨提示',
//                                    lock: true,
//                                    background: '#000', /* 背景色 */
//                                    opacity: 0.5,       /* 透明度 */
//                                    content: "<h4>"+returnedData.message+"</h4>",
//                                    icon: 'success.gif',
//                                    ok:  function () {
//                                        location.href = "/user/current/account";
//                                    }
//                                });
//                            }else{
//                                $.dialog({
//                                    title:'温馨提示',
//                                    lock: true,
//                                    background: '#000', /* 背景色 */
//                                    opacity: 0.5,       /* 透明度 */
//                                    content: "<h4>"+returnedData.message+"</h4>",
//                                    icon: 'error.gif',
//                                    cancel: true
//                                });
//                            }
                        });
            }
        }



    </script>
[#include "/customer/include/member_left_menu.ftl"]
    <!--左边 end-->
    <div class="memberRight">
        <div class="member_tab">
            <div class="member_tab">
                <a class="on" href="/member/account/log">活期宝</a>
                <a
                        href="${path}/member/current/to/into">活期宝购买</a>
                <a    href="${path}/member/current/to/out">活期宝撤购</a>
            </div>
        </div>


        <div class="alert alert-info"><a class="close" onclick="closeTips()" data-dismiss="alert">×</a>
            <p>活期宝购买后 当日会产生日化收益</p></div>
[#if status==0]
        <div  class="b-text">你还未开通活期宝账户，请先<a class="fred" href="javascript:void(0)" onclick="opens()" target="_blank">开通活期宝账户</a>。</div>
[/#if]
[#if status==1]
    <div class="b-data" style="padding:20px">
        <h1 >账户详情</h1 >
        <div class="memberInfo">
            <div class="fleft" style="height: 80px">
                <b><a href="javascript:void(0)" rel="tooltip" >活期宝总额</a></b>
                <em>￥ ${currency(yuEbao.total)}</em>
            </div>
            <ul class="fright">
                <li class="borderNone">
                    <span><p title="冻结金额账户中暂时冻结的金额，一般是投标中(尚未满标审核)">活期宝总收益</p><b>￥${currency(yuEbao.total_income)}</b></span>
                    <span><p title="待收资金">日收益</p><b>${yield*100 } %</b></span>
                    <span><button class="layui-btn   layui-btn-danger"  style="width: 100px;background-color: #f3485a"
                            onclick="location.href='${path}/member/current/to/into'">购买活期宝</button>
                    </span>
                      <span><button class="layui-btn   layui-btn-danger"  style="width: 100px;background-color: #f3485a"
                                    onclick="location.href='${path}/member/current/to/out'">撤购活期宝</button>
                    </span>
                </li>
            </ul>
        </div>
        <h1>收益明细</h1>
        <table class="layui-table">
            <colgroup>

                <col width="100">

                <col width="100">
                <col width="100">
                <col width="100">

                <col width="100">
                <col width="100">
                <col width="100">
            </colgroup>
            <thead>
            <tr>
                <th>编号</th>
                <th>类型</th>
                <th>操作金额</th>
                <th>总额</th>

                <th>累计收益</th>
                <th>备注</th>
                <th>时间</th>
            </tr>
            </thead>
        [#list yuEbaoLogs as yuEbaoLog]
            <tr>
                <td>${yuEbaoLog.id }</td>
                <td>
                ${p2p_get_dict('yuebao_log_type', yuEbaoLog.type)}
                </td>
                <td>￥${yuEbaoLog.money }</td>
                <td>￥${yuEbaoLog.total }</td>

                <td>￥${yuEbaoLog.total_income }</td>
                <td>${yuEbaoLog.remark }</td>
                <td>${p2p_date_format(yuEbaoLog.addtime,"yyyy-MM-dd") }</td>
            </tr>
        [/#list]
        </table>



    </div>
[/#if]
    </div>
</div>

[#include "/customer/include/footer.ftl"]

</body>
</html>